﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Employee_VacancyManager : System.Web.UI.Page
{
    InterviewerMethord IM = new InterviewerMethord();
    string UserName = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadData();
    }
    private void LoadData()
    {
        try
        {
            UserName = Session["User"].ToString();
            DataSet ds = IM.ReturnAllVacancyInformation(UserName);
            Session["Vacancy"] = ds;
            GVVacancyInfor.DataSource = ds.Tables[0].DefaultView;
            GVVacancyInfor.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        DataSet ds = IM.ReturnVacancyInforFollowSearch(UserName, ddlTypeSearch.SelectedValue, txtTextSearch.Text);
        Session["Vacancy"] = ds;
        GVVacancyInfor.DataSource = ds.Tables[0].DefaultView;
        GVVacancyInfor.DataBind();
    }
    protected void GVInterviewInfor_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        DataSet dsCurrent = (DataSet)Session["Vacancy"];
        GVVacancyInfor.DataSource = dsCurrent.Tables[0].DefaultView;
        GVVacancyInfor.PageIndex = e.NewPageIndex;
        GVVacancyInfor.DataBind();
    }
}